// component/Vast-module/Vast-custom-popbox/Vast-custom-popbox.js








Component({
	/**
	 * 组件的属性列表
	 */
	properties: {

		showClose:{
			type: Boolean,
			value: true,
		},

		datainfo: {
			type: Object,
			value: {},
		},
		
		overlay_show: {
			type: Boolean,
			value: false,
		}

	},


	observers: {
    'datainfo': function(newVlu) {
			if(newVlu){
				this.setData({
					datainfo_obs: newVlu
				})
			}
    }
  },



	/**
	 * 组件的初始数据
	 */
	data: {

	},

	/**
	 * 组件的方法列表
	 */
	methods: {

		// 关闭弹窗
		onClickHide(e){
			this.setData({
				overlay_show: false
			})
		},

		handleEvent_btA(event){
			// console.log(event)
			let bta_url = event.currentTarget.dataset.bta_url 
			if(bta_url && bta_url !== ''){
				wx.redirectTo({
					url: bta_url,
				})
			}
			this.onClickHide();

		},

		handleEvent_btB(event){
			// console.log(event)
			let btb_url = event.currentTarget.dataset.btb_url
			this.triggerEvent("itemChang",event.currentTarget.dataset )  
			if(btb_url && btb_url !== ''){
				wx.redirectTo({
					url: btb_url,
				})
				/** 增加一个点击后的回调 回传到父组件 */
			}
			this.onClickHide();
		}
	}
})
